package com.itheima.io;

import java.io.*;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        //字节输出流
        FileOutputStream fileOutputStream = new FileOutputStream("D:\\a.txt");
        fileOutputStream.write("gdgdgewfwddwd".getBytes());
        fileOutputStream.close();


        //字节输入流
        FileInputStream fileInputStream = new FileInputStream("D:\\a.txt");
        byte[] bys = new byte[1024];
        int len = 0;
        while ((len = fileInputStream.read(bys)) != -1) {
            System.out.println(new String(bys, 0, len));
        }
        fileInputStream.close();
    }
}

